package com.learning.mapper;

import com.learning.entity.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 题目表 Mapper 接口
 * </p>
 *
 * @author itRao
 * @since 2024-05-24
 */
@Mapper
public interface QuestionMapper extends BaseMapper<Question> {

    /**
     * 动态条件查询题目
     * @return
     */
    List<Question> query(Question question);


    /**
     * 根据题目id查询题目表的题目类型、题目内容、题目难易度
     */
    @Select("select question_content, type, difficulty from question where id = #{id}")
    Question queryById(Long id);
}
